<html xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:mtps="http://msdn2.microsoft.com/mtps" xmlns:mshelp="http://msdn.microsoft.com/mshelp" xmlns:ddue="http://ddue.schemas.microsoft.com/authoring/2003/5" xmlns:msxsl="urn:schemas-microsoft-com:xslt"><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" /><META NAME="BuildDateTime" CONTENT="2013-01-25 11:57:43" /><META NAME="BuildVersion" CONTENT="1.0.13025.1158" /><META NAME="save" CONTENT="history" /><META NAME="DCSext.Title" CONTENT="SharePoint 2013: Create a provider-hosted app that customizes app installation" /><title>SharePoint 2013: Create a provider-hosted app that customizes app installation</title><meta name="Language" content="en-us" /><meta name="Microsoft.Help.Id" content="0b0e54d8-4127-488c-86d8-4660e6c9ed0b" /><meta name="Microsoft.Help.ContentType" content="Concepts" /><style type="text/css">
                        .userDataStyle {
                        BEHAVIOR: url(#default#userData)
                        }
                        DIV.saveHistory {
                        BEHAVIOR: url(#default#savehistory)
                        }
                        IMG.toggle {
                        BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; BORDER-TOP: 0px; MARGIN-RIGHT: 5px; BORDER-RIGHT: 0px
                        }
                        IMG#toggleAllImage {
                        MARGIN-LEFT: 0px; VERTICAL-ALIGN: middle
                        }
                        MSHelp\:link {
                        COLOR: #0000ff; CURSOR: hand; TEXT-DECORATION: underline; hoverColor: #3366ff
                        }
                        MSHelp\:link:visited {
                        COLOR: #0481da
                        }
                        BODY {
                        FONT-STYLE: normal; MARGIN: 0px; WIDTH: 100%; FONT-FAMILY: Verdana; BACKGROUND: #ffffff; COLOR: #000000; FONT-SIZE: medium; FONT-WEIGHT: normal
                        }
                        DL {
                        MARGIN-TOP: 15px; PADDING-LEFT: 1px; MARGIN-BOTTOM: 5px
                        }
                        DL.authored DT {
                        MARGIN-TOP: 2px
                        }
                        DD {
                        MARGIN-LEFT: 0px
                        }
                        UL {
                        LIST-STYLE-TYPE: disc; MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; MARGIN-LEFT: 17px
                        }
                        UL UL {
                        LIST-STYLE-TYPE: disc; MARGIN-TOP: 3px; MARGIN-BOTTOM: 4px; MARGIN-LEFT: 17px
                        }
                        OL {
                        LIST-STYLE-TYPE: decimal; MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; MARGIN-LEFT: 28px
                        }
                        OL OL {
                        LIST-STYLE-TYPE: lower-alpha; MARGIN-TOP: 3px; MARGIN-BOTTOM: 4px; MARGIN-LEFT: 28px
                        }
                        OL OL OL {
                        LIST-STYLE-TYPE: lower-roman; MARGIN-TOP: 3px; MARGIN-BOTTOM: 4px; MARGIN-LEFT: 28px
                        }
                        LI {
                        MARGIN-TOP: 5px; MARGIN-BOTTOM: 5px
                        }
                        P {
                        MARGIN-TOP: 10px; MARGIN-BOTTOM: 5px
                        }
                        A:link {
                        COLOR: #0000ff
                        }
                        A:visited {
                        COLOR: #dd7c3b
                        }
                        A:hover {
                        COLOR: #3366ff
                        }
                        CODE {
                        FONT-FAMILY: Monospace, Courier New, Courier; COLOR: #000066; FONT-SIZE: 105%
                        }
                        SPAN.parameter {
                        FONT-STYLE: italic
                        }
                        SPAN.italic {
                        FONT-STYLE: italic
                        }
                        SPAN.selflink {
                        FONT-WEIGHT: bold
                        }
                        SPAN.nolink {
                        FONT-WEIGHT: bold
                        }
                        DIV#mainSection {
                        WIDTH: 100%; FONT-SIZE: 62.5%
                        }
                        HTML &gt; BODY #mainSection {
                        WIDTH: 100%; FONT-SIZE: 73%
                        }
                        DIV#mainBody {
                        MARGIN-TOP: 10px; MARGIN-LEFT: 15px; FONT-SIZE: 100%
                        }
                        HTML &gt; BODY #mainBody {
                        PADDING-BOTTOM: 20px; MARGIN-TOP: 10px; MARGIN-LEFT: 15px; FONT-SIZE: 93%
                        }
                        DIV#mainBody P {
                        PADDING-RIGHT: 5px
                        }
                        DIV#mainBody OL {
                        PADDING-RIGHT: 5px
                        }
                        DIV#mainBody UL {
                        PADDING-RIGHT: 5px
                        }
                        DIV#mainBody DL {
                        PADDING-RIGHT: 5px
                        }
                        DIV#header {
                        PADDING-BOTTOM: 0px; BACKGROUND-COLOR: #ffffff; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; PADDING-TOP: 0px
                        }
                        DIV#header TABLE {
                        WIDTH: 100%
                        }
                        DIV#header TABLE TD {
                        MARGIN-TOP: 0px; PADDING-RIGHT: 20px; MARGIN-BOTTOM: 0px; COLOR: #0000ff; FONT-SIZE: 70%
                        }
                        DIV#header TABLE TR#headerTableRow2 TD {
                        PADDING-LEFT: 13px
                        }
                        DIV#header TABLE TR#headerTableRow3 TD {
                        PADDING-LEFT: 15px; PADDING-TOP: 2px
                        }
                        DIV#header TABLE#bottomTable {
                        TEXT-ALIGN: left; PADDING-BOTTOM: 5px; PADDING-LEFT: 15px; BORDER-TOP: #ffffff 1px solid; PADDING-TOP: 5px
                        }
                        DIV#mainSection TABLE TD.imageCell {
                        WHITE-SPACE: nowrap
                        }
                        DIV#mainBody DIV.alert {
                        WIDTH: 98.9%
                        }
                        DIV#mainBody DIV.code {
                        WIDTH: 98.9%
                        }
                        DIV#mainBody DIV.tableSection {
                        WIDTH: 98.9%
                        }
                        DIV#mainBody DIV.section DIV.alert {
                        WIDTH: 100%
                        }
                        DIV#mainBody DIV.section DIV.code {
                        WIDTH: 100%
                        }
                        DIV#mainBody DIV.section DIV.tableSection {
                        WIDTH: 100%
                        }
                        DIV#mainBody DIV.section UL DIV.alert {
                        WIDTH: 100%
                        }
                        DIV#mainBody DIV.section UL DIV.code {
                        WIDTH: 100%
                        }
                        DIV#mainBody DIV.section UL DIV.tableSection {
                        WIDTH: 100%
                        }
                        DIV#mainBody DIV.section OL DIV.alert {
                        WIDTH: 100%
                        }
                        DIV#mainBody DIV.section OL DIV.code {
                        WIDTH: 100%
                        }
                        DIV#mainBody DIV.section OL DIV.tableSection {
                        WIDTH: 100%
                        }
                        DIV.alert P {
                        MARGIN-TOP: 5px; MARGIN-BOTTOM: 8px
                        }
                        DIV.code P {
                        MARGIN-TOP: 5px; MARGIN-BOTTOM: 8px
                        }
                        DD P {
                        MARGIN-TOP: 2px; MARGIN-BOTTOM: 8px
                        }
                        DIV.tableSection P {
                        MARGIN-TOP: 1px; MARGIN-BOTTOM: 4px
                        }
                        LI P {
                        MARGIN-TOP: 2px; MARGIN-BOTTOM: 2px
                        }
                        DIV.seeAlsoNoToggleSection DL {
                        MARGIN-TOP: 8px; PADDING-LEFT: 1px; MARGIN-BOTTOM: 1px
                        }
                        DIV.seeAlsoNoToggleSection DD P {
                        MARGIN-TOP: 2px; MARGIN-BOTTOM: 8px
                        }
                        DIV.section DL {
                        MARGIN-TOP: 8px; PADDING-LEFT: 1px; MARGIN-BOTTOM: 1px
                        }
                        DIV.section DD P {
                        MARGIN-TOP: 2px; MARGIN-BOTTOM: 8px
                        }
                        DIV.code TABLE {
                        BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; MARGIN-TOP: -0.4em; WIDTH: 100%; MARGIN-BOTTOM: 5px; FONT-SIZE: 95%; BORDER-TOP: 0px; BORDER-RIGHT: 0px
                        }
                        DIV.code TABLE TH {
                        BORDER-BOTTOM: #c8cdde 1px solid; PADDING-LEFT: 5px; PADDING-RIGHT: 5px; BACKGROUND: #efeff7; COLOR: #000066; FONT-WEIGHT: bold
                        }
                        DIV.code TABLE TD {
                        PADDING-LEFT: 5px; PADDING-RIGHT: 5px; BACKGROUND: #f7f7ff; BORDER-TOP: #ffffff 1px solid; PADDING-TOP: 5px
                        }
                        SPAN#runningHeaderText {
                        PADDING-LEFT: 13px; COLOR: #8c8c8c; FONT-SIZE: 90%
                        }
                        SPAN#nsrTitle {
                        FONT-FAMILY: arial; COLOR: #000000; FONT-SIZE: 160%; FONT-WEIGHT: 400
                        }
                        DIV#footer {
                        PADDING-BOTTOM: 6px; MARGIN: 0px; PADDING-LEFT: 1px; WIDTH: 100%; PADDING-RIGHT: 1px; FONT-SIZE: 80%; PADDING-TOP: 8px
                        }
                        HTML &gt; BODY DIV#footer {
                        PADDING-BOTTOM: 6px; MARGIN: 0px; PADDING-LEFT: 1px; WIDTH: 98%; PADDING-RIGHT: 1px; FONT-SIZE: 80%; PADDING-TOP: 2px
                        }
                        DIV.seeAlsoNoToggleSection {
                        PADDING-BOTTOM: 2px; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 15px; MARGIN-LEFT: 0px; PADDING-TOP: 2px
                        }
                        DIV.section {
                        PADDING-BOTTOM: 0px; PADDING-LEFT: 16px; WIDTH: 100%; PADDING-RIGHT: 15px; MARGIN-LEFT: 0px; PADDING-TOP: 0px
                        }
                        HTML &gt; BODY DIV.section {
                        PADDING-BOTTOM: 2px; PADDING-LEFT: 16px; WIDTH: 97%; PADDING-RIGHT: 15px; MARGIN-LEFT: 0px; PADDING-TOP: 2px
                        }
                        DIV.seeSection {
                        PADDING-BOTTOM: 2px; PADDING-LEFT: 16px; WIDTH: 100%; PADDING-RIGHT: 15px; MARGIN-LEFT: 0px; PADDING-TOP: 0px
                        }
                        .heading {
                        MARGIN-TOP: 18px; MARGIN-BOTTOM: 8px; FONT-WEIGHT: bold
                        }
                        H1.heading {
                        COLOR: #003399; FONT-SIZE: 145%
                        }
                        .subHeading {
                        MARGIN-BOTTOM: 4px; FONT-WEIGHT: bold
                        }
                        .procedureSubHeading {
                        MARGIN-BOTTOM: 4px; FONT-WEIGHT: bold
                        }
                        H3.subHeading {
                        COLOR: #003399; FONT-SIZE: 125%; FONT-WEIGHT: 800
                        }
                        H3.procedureSubHeading {
                        COLOR: #003399; FONT-SIZE: 100%
                        }
                        H4.subHeading {
                        FONT-VARIANT: small-caps; COLOR: #003399; FONT-SIZE: 110%; FONT-WEIGHT: 800
                        }
                        SPAN.labelheading {
                        COLOR: #003399; FONT-SIZE: 100%
                        }
                        DIV.labelheading {
                        COLOR: #003399; FONT-SIZE: 100%
                        }
                        IMG.copyCodeImage {
                        BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; MARGIN: 1px 3px 1px 1px; BORDER-TOP: 0px; BORDER-RIGHT: 0px
                        }
                        IMG.downloadCodeImage {
                        BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; BORDER-TOP: 0px; MARGIN-RIGHT: 3px; BORDER-RIGHT: 0px
                        }
                        IMG.viewCodeImage {
                        BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; BORDER-TOP: 0px; MARGIN-RIGHT: 3px; BORDER-RIGHT: 0px
                        }
                        IMG.note {
                        BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; BORDER-TOP: 0px; MARGIN-RIGHT: 3px; BORDER-RIGHT: 0px
                        }
                        DIV#mainSection TABLE {
                        BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; MARGIN-TOP: 5px; WIDTH: 98.9%; MARGIN-BOTTOM: 5px; FONT-SIZE: 100%; BORDER-TOP: 0px; BORDER-RIGHT: 0px
                        }
                        DIV#mainSection TABLE TR {
                        VERTICAL-ALIGN: top
                        }
                        DIV#mainSection TABLE TH {
                        BORDER-BOTTOM: #c8cdde 1px solid; TEXT-ALIGN: left; BORDER-LEFT: #d5d5d3 1px; BACKGROUND-COLOR: #efeff7; PADDING-LEFT: 5px; PADDING-RIGHT: 5px; COLOR: #000066
                        }
                        DIV#mainSection TABLE TD {
                        BORDER-BOTTOM: #d5d5d3 1px solid; BORDER-LEFT: #d5d5d3 1px; BACKGROUND-COLOR: #f7f7ff; PADDING-LEFT: 5px; PADDING-RIGHT: 5px
                        }
                        DIV#mainSection TABLE TD.imageCell {
                        WHITE-SPACE: nowrap
                        }
                        DIV.code TABLE {
                        BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; WIDTH: 100%; MARGIN-BOTTOM: 5px; FONT-SIZE: 95%; BORDER-TOP: 0px; BORDER-RIGHT: 0px
                        }
                        DIV.code TABLE TH {
                        BORDER-BOTTOM: #c8cdde 1px solid; PADDING-LEFT: 5px; PADDING-RIGHT: 5px; BACKGROUND: #efeff7; COLOR: #000066; FONT-WEIGHT: bold
                        }
                        DIV.code TABLE TD {
                        PADDING-LEFT: 5px; PADDING-RIGHT: 5px; BACKGROUND: #f7f7ff; BORDER-TOP: #ffffff 1px solid; PADDING-TOP: 5px
                        }
                        DIV.alert TABLE {
                        BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; WIDTH: 100%; FONT-SIZE: 100%; BORDER-TOP: 0px; BORDER-RIGHT: 0px
                        }
                        DIV.alert TABLE TH {
                        PADDING-LEFT: 5px; PADDING-RIGHT: 5px; BACKGROUND: #efeff7; BORDER-BOTTOM-WIDTH: 0px; COLOR: #000066
                        }
                        DIV.alert TABLE TD {
                        PADDING-LEFT: 5px; PADDING-RIGHT: 5px; BACKGROUND: #f7f7ff; BORDER-TOP: #ffffff 1px solid
                        }
                        SPAN.copyCode {
                        TEXT-ALIGN: right; DISPLAY: inline; FLOAT: right; COLOR: #0000ff; FONT-SIZE: 90%; CURSOR: pointer; FONT-WEIGHT: normal; TEXT-DECORATION: underline
                        }
                        SPAN.copyCodeOnHover {
                        TEXT-ALIGN: right; DISPLAY: inline; FLOAT: right; COLOR: #e85f17; FONT-SIZE: xx-small; CURSOR: pointer; FONT-WEIGHT: normal; TEXT-DECORATION: underline
                        }
                        .downloadCode {
                        COLOR: #0000ff; FONT-SIZE: 90%; CURSOR: pointer; FONT-WEIGHT: normal
                        }
                        .viewCode {
                        COLOR: #0000ff; FONT-SIZE: 90%; CURSOR: pointer; FONT-WEIGHT: normal
                        }
                        DIV.code PRE {
                        FONT-FAMILY: Monospace, Courier New, Courier; WORD-WRAP: break-word; BACKGROUND: #f7f7ff; COLOR: #000066; FONT-SIZE: 105%
                        }
                        .tip {
                        FONT-STYLE: italic; COLOR: #0000ff; CURSOR: pointer; TEXT-DECORATION: underline
                        }
                        .math {
                        FONT-FAMILY: Times New Roman; FONT-SIZE: 125%
                        }
                        #devlangsMenu {
                        BORDER-BOTTOM: #f3cbb5 1px solid; POSITION: absolute; BORDER-LEFT: #f3cbb5 1px solid; PADDING-BOTTOM: 4px; PADDING-LEFT: 4px; PADDING-RIGHT: 8px; BACKGROUND: #fcece4; VISIBILITY: hidden; FONT-SIZE: 70%; BORDER-TOP: #f3cbb5 1px solid; BORDER-RIGHT: #f3cbb5 1px solid; PADDING-TOP: 4px
                        }
                        #memberOptionsMenu {
                        BORDER-BOTTOM: #f3cbb5 1px solid; POSITION: absolute; BORDER-LEFT: #f3cbb5 1px solid; PADDING-BOTTOM: 4px; PADDING-LEFT: 4px; PADDING-RIGHT: 8px; BACKGROUND: #fcece4; VISIBILITY: hidden; FONT-SIZE: 70%; BORDER-TOP: #f3cbb5 1px solid; BORDER-RIGHT: #f3cbb5 1px solid; PADDING-TOP: 4px
                        }
                        #memberFrameworksMenu {
                        BORDER-BOTTOM: #f3cbb5 1px solid; POSITION: absolute; BORDER-LEFT: #f3cbb5 1px solid; PADDING-BOTTOM: 4px; PADDING-LEFT: 4px; PADDING-RIGHT: 8px; BACKGROUND: #fcece4; VISIBILITY: hidden; FONT-SIZE: 70%; BORDER-TOP: #f3cbb5 1px solid; BORDER-RIGHT: #f3cbb5 1px solid; PADDING-TOP: 4px
                        }
                        .checkboxLabel {
                        PADDING-BOTTOM: 4px; COLOR: #0000ff; FONT-SIZE: 90%; CURSOR: pointer; TEXT-DECORATION: underline
                        }
                        IMG#devlangsDropdownImage {
                        BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; MARGIN-LEFT: 0px; VERTICAL-ALIGN: middle; BORDER-TOP: 0px; BORDER-RIGHT: 0px
                        }
                        IMG#memberOptionsDropdownImage {
                        BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; MARGIN-LEFT: 0px; VERTICAL-ALIGN: middle; BORDER-TOP: 0px; BORDER-RIGHT: 0px
                        }
                        IMG#memberFrameworksDropdownImage {
                        BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; MARGIN-LEFT: 0px; VERTICAL-ALIGN: middle; BORDER-TOP: 0px; BORDER-RIGHT: 0px
                        }
                        DIV.footerLine {
                        PADDING-BOTTOM: 6px; MARGIN: 0px; WIDTH: 100%; PADDING-TOP: 8px
                        }
                        DIV.hr1 {
                        PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; BACKGROUND: #c8cdde; HEIGHT: 1px; FONT-SIZE: 1px; PADDING-TOP: 0px
                        }
                        DIV.hr2 {
                        PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; BACKGROUND: #d4dfff; HEIGHT: 1px; FONT-SIZE: 1px; PADDING-TOP: 0px
                        }
                        DIV.hr3 {
                        PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; BACKGROUND: #eeeeff; HEIGHT: 1px; FONT-SIZE: 1px; PADDING-TOP: 0px
                        }
                        SPAN.cs {
                        DISPLAY: none
                        }
                        SPAN.vb {
                        DISPLAY: none
                        }
                        SPAN.cpp {
                        DISPLAY: none
                        }
                        SPAN.nu {
                        DISPLAY: inline
                        }
                        SPAN.fs {
                        DISPLAY: none
                        }
                        SPAN.code {
                        FONT-FAMILY: Monospace, Courier New, Courier; COLOR: #000066; FONT-SIZE: 105%
                        }
                        SPAN.ui {
                        FONT-WEIGHT: bold
                        }
                        SPAN.math {
                        FONT-STYLE: italic
                        }
                        SPAN.input {
                        FONT-WEIGHT: bold
                        }
                        SPAN.term {
                        FONT-STYLE: italic
                        }
                        SPAN.label {
                        FONT-WEIGHT: bold
                        }
                        SPAN.foreignPhrase {
                        FONT-STYLE: italic
                        }
                        SPAN.placeholder {
                        FONT-STYLE: italic
                        }
                        SPAN.keyword {
                        FONT-WEIGHT: bold
                        }
                        SPAN.typeparameter {
                        FONT-STYLE: italic
                        }
                        DIV.caption {
                        COLOR: #003399; FONT-SIZE: 100%; FONT-WEIGHT: bold
                        }
                        DIV.code SPAN.identifier {

                        }
                        DIV.code SPAN.keyword {
                        COLOR: #871f78
                        }
                        DIV.code SPAN.parameter {
                        FONT-STYLE: italic
                        }
                        DIV.code SPAN.literal {
                        COLOR: #8b0000
                        }
                        DIV.code SPAN.comment {
                        COLOR: #006400
                        }
                        SPAN.syntaxLabel {
                        COLOR: #0481da; FONT-WEIGHT: bold
                        }
                        SPAN.introStyle {
                        COLOR: darkgray
                        }
                        DIV.seeAlsoStyle {
                        PADDING-TOP: 5px
                        }
                        TD.nsrBottom {
                        WIDTH: 100%; HEIGHT: 0.6em
                        }
                        SPAN.clsGlossary {
                        COLOR: #509950; CURSOR: default; FONT-WEIGHT: bold
                        }
                        DIV.clsTooltip {
                        BORDER-BOTTOM: black 1px solid; POSITION: absolute; BORDER-LEFT: black 1px solid; PADDING-BOTTOM: 2px; BACKGROUND-COLOR: #ffffaa; PADDING-LEFT: 2px; PADDING-RIGHT: 2px; DISPLAY: none; FONT-FAMILY: Arial; COLOR: black; FONT-SIZE: 8pt; BORDER-TOP: black 1px solid; BORDER-RIGHT: black 1px solid; PADDING-TOP: 2px; TOP: 0px; LEFT: 0px
                        }
                        SPAN.feedbackcss {
                        WIDTH: 100%; MARGIN-LEFT: 15px; FONT-SIZE: 110%
                        }
                        DIV#feedbackarea TABLE {
                        BORDER-RIGHT-WIDTH: 0px; MARGIN-TOP: 0px; WIDTH: 300px; MARGIN-BOTTOM: 0px; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN-LEFT: 0px; BORDER-LEFT-WIDTH: 0px
                        }
                        DIV#feedbackarea TABLE TD {
                        BORDER-BOTTOM: 0px; TEXT-ALIGN: center; FONT-FAMILY: Verdana; FONT-SIZE: 100%
                        }
                        DIV#feedbackarea P {
                        MARGIN: 0px 5px 0px 6px; WIDTH: 100%; FONT-SIZE: 100%
                        }
                        DIV#feedbackarea H5 {
                        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0.7em; MARGIN-LEFT: 6px; FONT-SIZE: 10pt
                        }
                        P.feedbackarea {
                        BACKGROUND-COLOR: #d4dfff; ; WIDTH: expression(document.body.clientWidth-27); FONT-SIZE: 100%
                        }
                        INPUT#submitFeedback {
                        TEXT-ALIGN: center; FONT-SIZE: 100%
                        }
                        SPAN#feedbackarea {
                        WIDTH: 100%
                        }
                        DIV#feedbackarea {
                        WIDTH: 100%
                        }
                        SPAN.filterOnHover {
                        COLOR: #e85f17
                        }
                        SPAN.filter {
                        COLOR: #0000ff
                        }
                        A IMG {
                        BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; BORDER-TOP: 0px; BORDER-RIGHT: 0px
                        }
                    </style></head><body><div id="header"><table id="bottomTable" cellpadding="0" cellspacing="0"><tr id="headerTableRow1"><td align="left"><span id="runningHeaderText" /></td></tr><tr id="headerTableRow2"><td align="left"><span id="nsrTitle">SharePoint 2013: Create a provider-hosted app that customizes app installation</span></td></tr></table></div><div id="mainSection"><div id="mainBody"><font color="DarkGray"></font><p /><div class="summary"><p>Demonstrates how to create a provider-hosted app that creates a Picture library in the host web during app installation.</p></div><div class="introduction" /><a name="O15Readme_Description" /><h1 class="heading">Description</h1><div id="sectionSection0" class="section" name="collapseableSection" style=""><p><span class="label">Provided by:</span>&nbsp;&nbsp;<a href="http://mvp.microsoft.com/en-US/findanmvp/Pages/profile.aspx?MVPID=52a3f2aa-710f-4496-9b78-f240eccc74ad" target="_blank">Ted Pattison</a>, <a href="http://www.criticalpathtraining.com" target="_blank">Critical Path Training</a></p><p>The PhotoApp sample project is a provider-hosted app that customizes the app installation process using the app lifecycle event for app installation and uninstallation. The app is designed and implemented to register an app installation event handler, which makes it possible to write C# code that fires in the remote web whenever the app is installed in a target site (for example, the host web). In this sample, the C# code in the app installation event handler creates a Picture library in the host web to demonstrate what can be done using code to customize the app installation process.</p><p>The sample demonstrates how to create a provider-hosted app that creates a Picture library in the host web during installation. The app accomplishes this by registering the <span sdata="langKeyword" value="InstalledEventEndpoint"><span class="keyword">InstalledEventEndpoint</span></span> and the <span sdata="langKeyword" value="UninstallingEventEndpoint"><span class="keyword">UninstallingEventEndpoint</span></span> in the AppManifest.xml file, which causes the SharePoint host environment to call back into the remote web of the app during the <span sdata="langKeyword" value="AppInstalled"><span class="keyword">AppInstalled</span></span> event and the <span sdata="langKeyword" value="AppUninstalling"><span class="keyword">AppUninstalling</span></span> event using a Windows Communication Foundation (WCF) web service entry point.</p><p>When the PhotoApp app is installed, it creates a Picture Library (base list type 109) named <b>Photos</b> in the host web and uploads several files to demonstrate something that cannot be done declaratively. This is something that can only be done using code. The app also handles the app lifecycle event for app uninstallation in order to demonstrate app cleanup code, which deletes the Picture library when the app is uninstalled.</p><p>In addition to demonstrating how to implement event handlers for app installation and uninstallation, the app also demonstrates how to add a permission request to the app, which allows the app to create a Picture library in the host web. This is not something an app can do with the default set of app permissions. This provider-hosted app has been designed to run within an on-premises farm, and therefore it uses server-to-server (S2S) high trust to authenticate the app when the app calls into the SharePoint host environment</p><p>Key features illustrated in the sample:</p><ul><li><p>Registering <span sdata="langKeyword" value="InstalledEventEndPoint"><span class="keyword">InstalledEventEndPoint</span></span> and <span sdata="langKeyword" value="UninstallingEventEndPoint"><span class="keyword">UninstallingEventEndPoint</span></span> in the app manifest</p></li><li><p>Adding permission requests to the app manifest</p></li><li><p>Filtering permission requests by base list type</p></li><li><p>Authenticating calls from the app using a server-to-server (S2S) trust</p></li><li><p>Customizing app installation using code</p></li><li><p>Using C# and the client object model (CSOM) in the remote web to create a picture library and upload photos</p></li></ul></div><a name="O15Readme_Prereq" /><h1 class="heading">Prerequisites</h1><div id="sectionSection1" class="section" name="collapseableSection" style=""><p>This sample requires the following:</p><ul><li><p>A SharePoint 2013 development environment with a local SharePoint farm.</p></li><li><p>The SharePoint farm must be configured to support apps for SharePoint.</p></li><li><p>Visual Studio 2012 and Office Developer Tools for Visual Studio 2012.</p></li><li><p>Basic familiarity with the concepts of developing a provider-hosted app. See <a href="http://msdn.microsoft.com/en-us/library/fp142381.aspx" target="_blank">How to: Create a basic provider-hosted app for SharePoint</a>.</p></li></ul></div><a name="O15Readme_components" /><h1 class="heading">Key components of the sample</h1><div id="sectionSection2" class="section" name="collapseableSection" style=""><p>The sample consists of a Visual Studio 2012 solution with two projects. The first project, named <b>PhotoApp</b>, represents the portion of the provider-hosted app that is installed into the SharePoint host environment. The second project, named <b>PhotoAppWeb</b>, is an ASP.NET application that is used to implement the app's remote web.</p><p>The <b>AppManifest.xml</b> file in the PhotoApp project contains the permission request that is used to grant the app permission to create a Picture library. The AppManifest.xml file also contains XML elements to register event handers for <span sdata="langKeyword" value="InstalledEventEndPoint"><span class="keyword">InstalledEventEndPoint</span></span> and <span sdata="langKeyword" value="UninstallingEventEndPoint"><span class="keyword">UninstallingEventEndPoint</span></span>, which point to an entry point in the remote web named <b>AppEventReceiver.svc</b>.</p><p>The <b>AppEventReceiver.svc.cs</b> file contains the C# code that uses the client object model to create a Picture library in the host web named Photos, and to upload all the photo images that have been added to the Photos folder in the PhotoAppWeb project. </p><p>The <b>web.config</b> file in the PhotoAppWeb project contains three <span sdata="langKeyword" value="appSettings"><span class="keyword">appSettings</span></span> that are essential in configuring the S2S trust between the app and the SharePoint host environment.</p></div><a name="O15Readme_config" /><h1 class="heading">Configure the sample</h1><div id="sectionSection3" class="section" name="collapseableSection" style=""><p>Follow these steps to configure the sample.</p><ol><li><p>Run the Windows PowerShell script named <span class="ui">SetupS2STrust.ps1</span> to create an SSL certificate with both a .cer file and a .pfx file, and also to register a trusted security token issuer in the local SharePoint farm.</p></li><li><p>Open the <span class="ui">PhotoApp</span> solution.</p></li><li><p>Assign the <span sdata="langKeyword" value="Site URL"><span class="keyword">Site URL</span></span> property of the PhotoApp project with a URL that points to a test site in the local farm.</p></li></ol></div><h1 class="heading">Build the sample</h1><div id="sectionSection4" class="section" name="collapseableSection" style=""><p>Build and deploy the <span class="ui">PhotoApp</span> project.</p></div><a name="O15Readme_test" /><h1 class="heading">Run and test the sample</h1><div id="sectionSection5" class="section" name="collapseableSection" style=""><div class="subSection"><ol><li><p>Deploy the PhotoApp project. After the app has been installed, inspect the host web and verify that it contains a Picture library named Photos, which contains several photos.</p></li><li><p>Uninstall the app, and verify that the Photos picture library has been deleted.</p></li></ol></div></div><a name="O15Readme_Troubleshoot" /><h1 class="heading">Troubleshooting</h1><div id="sectionSection6" class="section" name="collapseableSection" style=""><p>If the app fails to install, troubleshoot the following aspects of your development environment.</p><ul><li><p>Make sure that your environment supports apps. In Visual Studio 2012, create a new SharePoint-hosted app and ensure you can deploy it in a test site on your farm. If you cannot, your environment is not configured to support apps for SharePoint.</p></li><li><p>Make sure that you can run S2S trust apps. Create a provider-hosted app, and choose <span class="ui">Use a certificate</span> when asked how you want to authenticate your app. Make sure that the certificate is configured correctly and that you have registered a trusted security token issuer. If you cannot successfully deploy and test a new provider-hosted app, you have a configuration issue with S2S trusts.</p></li><li><p>Inspect the <span sdata="langKeyword" value="appSettings"><span class="keyword">appSettings</span></span> element in the web.config file, and compare it to the SetupS2Strust.ps1 script. Verify that all the S2S trust settings are correct for your environment.</p></li></ul></div><a name="O15Readme_Changelog" /><h1 class="heading">Change log</h1><div id="sectionSection7" class="section" name="collapseableSection" style=""><p>First release: January 2013</p></div><a name="O15Readme_RelatedContent" /><h1 class="heading">Related content</h1><div id="sectionSection8" class="section" name="collapseableSection" style=""><ul><li><p><a href="http://msdn.microsoft.com/en-us/library/fp179923.aspx" target="_blank">How to: Set up an on-premises development environment for apps for SharePoint</a></p></li><li><p><a href="http://msdn.microsoft.com/en-us/library/fp142381.aspx" target="_blank">How to: Create a basic provider-hosted app for SharePoint</a></p></li><li><p><a href="http://msdn.microsoft.com/en-us/library/fp179930.aspx" target="_blank">Apps for SharePoint overview</a></p></li><li><p><a href="http://msdn.microsoft.com/en-us/library/fp179912.aspx" target="_blank">How to: Complete basic operations using SharePoint 2013 client library code</a></p></li><li><p><a href="http://msdn.microsoft.com/en-us/library/office/apps/fp179901" target="_blank">How to: Create high-trust apps for SharePoint 2013 using the server-to-server protocol</a></p></li><li><p><a href="http://msdn.microsoft.com/en-us/library/office/apps/fp142384.aspx" target="_blank">Authorization and authentication for apps in SharePoint 2013</a></p></li></ul></div></div></div></body></html>